package com.ktgj.service.service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.ktgj.common.core.web.domain.AjaxResult;
import com.ktgj.service.domain.*;
import com.ktgj.service.domain.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;

/**
 * 贵宾厅订单Service接口
 * 
 * @author ruoyi
 * @date 2021-09-03
 */
public interface IOrderViphallService 
{
    /**
     * 查询贵宾厅订单* 
     * @param orderviphallId 贵宾厅订单ID
     * @return 贵宾厅订单*/
    public OrderViphall selectOrderViphallById(Long orderviphallId);

    /**
     * 查询贵宾厅订单列表
     * 
     * @param orderViphall 贵宾厅订单* @return 贵宾厅订单集合
     */
    public List<OrderViphall> selectOrderViphallList(OrderViphall orderViphall);

    /**
     * 新增贵宾厅订单* 
     * @param orderViphall 贵宾厅订单* @return 结果
     */
    public int insertOrderViphall(OrderViphall orderViphall);

    /**
     * 修改贵宾厅订单* 
     * @param orderViphall 贵宾厅订单* @return 结果
     */
    public int updateOrderViphall(OrderViphall orderViphall);

    /**
     * 批量删除贵宾厅订单* 
     * @param orderviphallIds 需要删除的贵宾厅订单ID
     * @return 结果
     */
    public int deleteOrderViphallByIds(Long[] orderviphallIds);

    /**
     * 删除贵宾厅订单信息
     * 
     * @param orderviphallId 贵宾厅订单ID
     * @return 结果
     */
    public int deleteOrderViphallById(Long orderviphallId);

    /**
     * 贵宾厅填写订单
     * @param token
     * @param viphallId
     * @return
     */
    public FillOrderResponse queryHallOrderInfo(String token, Long viphallId) throws Exception;

    /**
     * 贵宾厅订单生成
     *
     * @param token     请求头
     * @param viphallId   贵宾厅id
     * @param payment     应付金额
     * @param points      积分
     * @param couponId    优惠卷id
     * @param totalsalePrice 订单总金额
     * @param usedDeposit 预留款
     * @param employeeId 操作人id
     * @return
     */
    public String saveOrder(String token, Long viphallId, String arrivalDate,
                          Long peopleNumber, BigDecimal payment, BigDecimal points,Long couponId,
                          BigDecimal totalsalePrice, BigDecimal usedDeposit, Long employeeId,
                          String contactName, String contactPhone, String usePoint, String useDeposits) throws Exception;

    /**
     * 贵宾厅订单收银台
     * @param customerId
     * @return
     */
    public Cashier queryByPayOrder(Long customerId, Long orderNumber, String businessType) throws Exception;

    /**
     * 订单核销
     * @param personNum
     * @param orderviphallId
     */
    public int descOrderVipHall(int personNum, Long orderviphallId);

    /**
     * 支付成功页面展示
     * @param orderviphallId
     * @return
     */
    public OrderViphall selectOrderViphallNumber(Long orderviphallId);

    /**
     * 首页-黄金会员-进行中/已使用
     * @param customerId
     * @return
     */
    public List<OrderConductOrUse> selectOrderViphallByStatus(Long customerId);

    /**
     * 订单二维码
     * @param customerId
     * @param orderviphallId
     * @return
     */
    public Map<String, Object> orderViphallQRCode(@Param("customerId") Long customerId,
                                                 @Param("orderviphallId") Long orderviphallId) throws Exception;

    public Map<String, Object> QRCodeDecryption(String decryption);

    /**
     * 贵宾厅订单详情
     * */
    public List<OrderViphall> selectOrderViphallByCustomerId(Long customerId, Long orderviphallId);

    /**
     * 删除订单
     * */
    public int updateOrderViphallByIsDeleted(Long orderviphallId);

    /**
     * 取消订单-立即支付（修改状态）-申请退款
     * */
    public int updateOrderViphallByPaymentStatus(Long customerId, Long orderviphallId, String type);

    /**
     * 修改订单
     * */
    public int updateOrderViphallByContactPhone(OrderViphall orderviphall);

    public Map<String, Object> queryViphallTrip(Long orderviphallId);

    /**
     * 定制行程-单程
     * @param customerId
     * @return
     */
    public OrderViphall queryItinerary(Long customerId);

    public Map<String, Object> selectItinerary(Long orderviphallId);

    /**
     * 微信小程序支付
     * @param openId
     * @param orderNumber
     * @return
     */
    public Map<String, Object> wechatPay(String openId, Long orderNumber, BigDecimal amount, String type) throws Exception;

    /**
     * 修改贵宾厅订单*
     * @param orderViphall 贵宾厅订单* @return 结果
     */
    public int updateByOrderNumber(OrderViphall orderViphall);

    /**
     * 查询会员贵宾厅订单列表
     * */
    public List<OrderViphall> selectOrderViphallByCustomer(Long customerId, String type) throws Exception;

    public int queryVipHallOrderNumber(Long customerId);

    /**
     * 贵宾厅订单列表
     * */
    public List<OrderViphall> selectVipchannelOrederListVo(VipchannelOrederParameterVo vipchannelOrederParameterVo);

    /**
     * 贵宾厅订单详细
     * */
    public OrderViphallDetailsVo selectVipHallDetails(Long orderId, String orderNum) throws Exception;
    /**
     * 贵宾厅订单详细+orderNumber
     * */
    public OrderViphallDetailsVo selectVipHallDetailsByorderNumber(Long orderNumber)throws Exception;

    /**
     * 行程贵宾厅订单
     * */
    public JourneyOrderViphallVo journeyOrderViphallVo(Long orderviphallId);

    /**
     * 贵宾厅退单
     * */
    public int chargebackOrderViphall(Long orderviphallId);

    /**
     * 订单号获取贵宾厅订单信息
     * */
    public OrderViphall orderNum(String orderNum);

    /**
     * 员工所属部门贵宾厅列表
     * */
    public List<OrderViphall> deptVipHallOrderList(Long id);

    public String getVipHallOrderQRCode(OrderQRCodeVo orderQRCodeVo);

    public AjaxResult checkViphallOrderORCode(String qrCode, String userCount, String deptId);
}
